



import Vue from "vue";

//全局注册过滤器
Vue.filter("rolename", (value) => {
    if (!value) return value;

    switch (value) {
        case '1':
            return "普通客户"
            break;
        case '2':
            return "vip"
            break;
        case '3':
            return "销售代表"
            break;
        case '4':
            return "销售主管"
            break;
        case '5':
            return "经理"
            break;
    }
})

Vue.filter('colortype', (value) => {
    if (!value) return value;

    switch (value) {
        case '1':
            return "warning"
            break;
        case '2':
            return "primary"
            break;
        case '3':
            return "info"
            break;
        case '4':
            return "success"
            break;
        case '5':
            return "danger"
            break;
    }
})


import moment from "moment"

Vue.filter('timeFormat', (value, format) => {
    if (!value) return value;
    format = format || 'YYYY/MM/DD HH:mm:ss'
    return moment(value).format(format)
})

